package cn.wolfcode.producer._06_filter;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;

/**
 * @Author: 乱梦天真
 * @Description: TODO
 * @Date: 2020/5/10 19:03
 */
public class Producer1 {
    public static void main(String[] args) throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("wolfcode_producer");
        producer.setNamesrvAddr("127.0.0.1:9876");
        producer.start();
        Message message = new Message("06-filter","TagA","你好呀".getBytes());
        //TODO 自定义属性过滤(SQL92)
        message.putUserProperty("age","18");
        SendResult sendResult = producer.send(message);
        System.out.println(sendResult.getMsgId());
        producer.shutdown();
    }
}